<template>
  <div>
    <h1>评论</h1>
    <p>
      内容：
      <textarea name="" id="" cols="30" rows="10" v-model="form.content"></textarea>
    </p>
    <button @click="addcom">提交</button>
  </div>
</template>

<script>
export default {
  name: "comm",
  data() {
    return {
      form: {'user': localStorage.getItem('userid'), 'shop': this.$route.query.id}
    }
  },
  methods: {
    addcom() {
      this.$axios.post('table/com/', this.form)
        .then(res => {
          if (res.data.code == 200) {
            alert('评论成功')
            this.form = {}
          }
        })
    }

  }
}
</script>

<style scoped>

</style>
